'use strict'

class getUser {

    constructor() {
        this.param = '/'
    }

    async get(c) {
        try {
            var openid = c.box.user.openid;
            let sqltext1 = `select * from users where openid = '${openid}'`
            let r1 = await c.service.psql.query(sqltext1);
            return c.send(r1.rows[0]);
        } catch (err) {
            console.log(err);
            return c.status(500).send('获得用户数据失败')
        }
    }
}

module.exports = getUser;